package shapes;

import java.awt.Color;
import java.awt.Graphics;

/**
 * Cette classe contient les informations pour les objets
 * de type Ligne
 * @author Maria Garcia Carrasco et Andrew Bolduc
 */

public class Line extends AbstractShape {
	
	/**
	 * @param shapeID
	 * @param shape
	 * @param color
	 * @param xOrigin
	 * @param yOrigin
	 * @param secondX
	 * @param secondY
	 */
	public Line(int shapeID,String shape, Color color, int xOrigin, int yOrigin, int secondX, int secondY) {
		super(shapeID, shape, color, xOrigin, yOrigin, secondX, secondY);
	}

	/**
	 * @return
	 */
	/*public int getSecondX() {
		return super.getSecondX();
	}*/

	/**
	 * @return
	 */
	/*public int getSecondY() {
		return super.getSecondY();
	}*/
	
	/* (non-Javadoc)
	 * @see shapes.AbstractShape#draw(java.awt.Graphics)
	 */
	@Override
	public void draw(Graphics graphics) {
		graphics.setColor(this.getColor());
		graphics.drawLine(super.getxCoord(),super.getyCoord(), super.getSecondX(), super.getSecondY());
	}

	@Override
	public float area() {
		float area = (float)Math.sqrt((Math.pow((this.getxCoord() - super.getSecondX()), 2)) + (Math.pow((this.getyCoord() - super.getSecondY()), 2)));
		return area;
	}

	@Override
	public int getDistance() {
		return (int) area();
	}

	/*public void setsecondX(int secondX) {
		super.setSecondX(secondX);
	}*/

	/*public void setsecondY(int secondY) {
		super.setSecondY(secondY);
	}*/

}